The Hierarchy of LR-Attributed Grammars
نویسندگان
چکیده
The problem of attribute evaluation during LR parsing is considered. Several definitions of LR-attributed grammars are presented. Relations of corresponding attribute grammar classes are analysed. Also the relations between LR-attributed grammars and LL-attributed grammars and between LR-attributed grammars and a class of one-pass attributed grammars based on left-corner grammars are considered.
منابع مشابه
Rie, a Compiler Generator Based on a One-pass-type Attribute Grammar
We herein describe a compiler generator, Rie, which is based on a one-pass-type attribute grammar. LR-attributed grammars are one class of attribute grammars in which attribute evaluation can be performed in one pass during LR parsing without creating a parse tree. Rie was developed based on a variant of an LR-attributed grammar called ECLR-attributed grammar (equivalence class LR-attributed gr...
متن کاملCh(k) Grammars: A Characterization of LL(k) Languages
From the point of view of parsing the LL(K] grammars constitute a very attractive class of context-free grammars. For each LL{K] grammar a top-down parsing algorithm can be devised which is essentially a one-state deterministic push-down automaton. From a more theoretiG point of view LL[K) grammars are attractive as well. It is well-known, for example, that it is decidable whether two LLfk) gra...
متن کاملA Compiler Generator for Attributive Evaluation During LR Parsing
A compiler generator called Metauncle is introduced. Metauncle produces one-pass compilers in which all attributes are evaluated in conjunction with LR parsing. The description of a language is given to Metauncle as an L-attributed grammar, and the system transforms it before generation of an evaluator to another attribute grammar satisfying the requirements for evaluation. The transformed gram...
متن کاملOn the Translation of Languages from Left to Right
There has been much recent interest in languages whose grammar is sufficiently simple that an efficient left-to-right parsing algorithm can be mechanically produced from the grammar. In this paper, we define LR(k) grammars, which are perhaps the most general ones of this type, and they provide the basis for understanding all of the special tricks which have been used in the construction of pars...
متن کاملParallel Evaluation of LR–Attributed Grammars
In this paper, we present a novel approach to the parallel implementation of one–pass compilers. Based on attribute grammars, it combines the well–known LR parsing technique for the underlying context–free grammar with the parallel evaluation of attribution rules. In order to integrate syntactic and semantic analysis, the LR parsing stack is enriched by additional information, resulting in a so...
متن کامل